<div class="tab-pane fade" id="propTab">
    <if condition="$house['prop']">
        <volist name="house.prop" id="prop" offset="0" length='1'>
            <div>
                <div class="form-group">
                    <label class="control-label col-sm-2">产权单位:</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="prop_unit_name[]" value="{$prop.unit_name}" placeholder="请输入产权单位">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-sm-2">楼层范围:</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="prop_description[]" value="{$prop.description}" placeholder="请输入楼层范围">
                    </div>
                    <label class="control-label col-sm-2">产权面积:</label>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <input type="text" class="form-control" name="prop_area[]" value="{$prop.area}" placeholder="请输入产权面积">
                            <div class="input-group-addon">M&sup2;</div>
                        </div>
                    </div>
                </div>
                <hr />
            </div>
        </volist>
        <volist name="house.prop" id="prop" offset="1">
            <div>
                <div class="form-group">
                    <label class="control-label col-sm-2">产权单位:</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control" name="prop_unit_name[]" value="{$prop.unit_name}" placeholder="请输入产权单位">
                    </div>
                    <button type="button" class="btn btn-primary" style="margin-left: 10px;" onclick="delProp(this)">删除</button>
                </div>
                <div class="form-group">
                    <label class="control-label col-sm-2">楼层范围:</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="prop_description[]" value="{$prop.description}" placeholder="请输入楼层范围">
                    </div>
                    <label class="control-label col-sm-2">产权面积:</label>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <input type="text" class="form-control" name="prop_area[]" value="{$prop.area}" placeholder="请输入产权面积">
                            <div class="input-group-addon">M&sup2;</div>
                        </div>
                    </div>
                </div>
                <hr />
            </div>
        </volist>
    <else/>
        <div>
            <div class="form-group">
                <label class="control-label col-sm-2">产权单位:</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="prop_unit_name[]" value="" placeholder="请输入产权单位">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-2">楼层范围:</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="prop_description[]" value="" placeholder="请输入楼层范围">
                </div>
                <label class="control-label col-sm-2">产权面积:</label>
                <div class="col-sm-4">
                    <div class="input-group">
                        <input type="text" class="form-control" name="prop_area[]" value="" placeholder="请输入产权面积">
                        <div class="input-group-addon">M&sup2;</div>
                    </div>
                </div>
            </div>
            <hr />
        </div>
    </if>
    <button type="button" id="btn_prop" class="btn btn-primary pull-right">添加产权</button>
</div>

<script type="text/javascript">

    $(function () {
        $("#btn_prop").bind("click",addProp);
    });

    function addProp() {
        $("#btn_prop").before($("#prop_template").html());
    }

    function delProp(obj) {
        $(obj).parent().parent().remove();
    }
</script>